define(['crud'],function(crud){
	var mapurlIP = "http://172.29.1.26:8090/iserver/services/";  //app23.js  sql查询642行待修改
	var mapPan;
    var scenePan;
    var map;    
	var flyManager;
    var mapurl = mapurlIP + "3D-py057/rest/realspace";
    var map2url = new Array(
		mapurlIP + "map-py017/rest/maps/底图" ,
		mapurlIP + "map-py017/rest/maps/地形图" ,
		mapurlIP + "map-py017/rest/maps/ZG用地规划" ,
		mapurlIP + "map-py017/rest/maps/ZG市政规划" ,
		mapurlIP + "map-py017/rest/maps/ZG防灾景观规划" ,
		mapurlIP + "map-py017/rest/maps/修建性规划" ,
		mapurlIP + "map-py017/rest/maps/居住统计" ,
		mapurlIP + "map-py017/rest/maps/条件方案地块"
	);
	
	//条件查询(sql)所需
	SqlSelectJson = [
		{
			"showName": "编号",
			"parameter": "SmID",
			"name": "建筑基地2@py3.1",
			"url": mapurlIP + "map-py017/rest/maps/修建性规划"
		},{
			"showName": "名称",
			"parameter": "SmID",
			"name": "建筑基地2@py3.1",
			"url": mapurlIP + "map-py017/rest/maps/修建性规划"
		}
	];


	function onload(Cesium,APP){

		

		viewer = new Cesium.Viewer('cesiumContainer',{
			
		});
		var AllLayers = viewer.imageryLayers;
		scene = viewer.scene;
		var imageryLayers = viewer.imageryLayers;
        var baseLayer = imageryLayers.get(0);
        var list;
        var layerList;
		try {
			var promise = scene.open(mapurl); 
			Cesium.when(promise,function(layer){ 

				//初始化
				layer3d = layer;
				//设置相机位置、视角，便于观察场景
				scene.camera.setView({
					//destination : new Cesium.Cartesian3.fromDegrees(116.464386111111,36.30124166666,117.224091),
					// orientation : {
					// 	heading : 117.69,
					// 	pitch : 50.300289
					// } 
					destination : new Cesium.Cartesian3.fromDegrees(116.462614,36.267884,663.045691),
					orientation : {
						heading : 0,
						pitch : 30
					} 
				}); 
				//需要控制部分图层隐藏.
				APP.threelayer(layer);
			});

		}catch(e){
			alert('渲染时发生错误，已停止渲染。');
		}

		//三维三维分屏
		scene.multiViewportMode = Cesium.MultiViewportMode["HORIZONTAL"];
		
	}
	
	return {onload: onload};
});